package ch.so.sogis.database;

import java.sql.*;


public class dbObj {
	
	private Connection dbcon;
	
	
	public dbObj() {
		try {
			Class.forName("org.h2.Driver");
			// DB in Datei
			//dbcon = DriverManager.getConnection("jdbc:h2:mem/"+dbname, "", "");
			// DB in Memory
			dbcon = DriverManager.getConnection("jdbc:h2:mem:","", "");
			dbcon.setAutoCommit(false);
		} catch(ClassNotFoundException ex) {
	    	System.out.println("ClassNotFoundEx");
	    	System.err.println("ClassNotFoundException: " + ex.getMessage());
		} catch(SQLException ex) {
			System.out.println("SQLEx");
			System.err.println("SQLException : " + ex.getMessage());
		}

	}
	
	
	
	public Connection getConnection() {	
		return this.dbcon;
	}

}
